import Mock from 'mockjs'
const list = Mock.mock({
  'list|10': [
    {
      agreementId: '@id',
      agreementName: '@csentence',
      agreementNo: '@integer',
      agreementVersion: '@string',
      agreementContent: '<p>11111</p>',
      'agreementType|1': [1, 2],
      'status|1': [0, 1],
      createTime: '@datetime'
    }
  ]
})
const dictMap = {
  agreementType: {
    1: '222',
    2: '333'
  }
}
const pub = {
  isMore: 0,
  pageIndex: 1,
  pageSize: 10,
  startIndex: 0,
  totalNum: 1,
  totalPage: 1
}
export default [
  // 协议设置
  // 标准协议列表分页查询
  {
    url: '/general/agreement/listStandardAgreementPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...list,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  },
  // 标准协议历史查看
  {
    url: '/general/agreement/listAgreementVersionPageByType',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...list,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  },
  // 根据协议ID删除协议
  {
    url: '/general/agreement/deleteStandardAgreementById',
    type: 'get',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: ''
      }
    }
  },
  // 根据协议ID查询协议
  {
    url: '/general/agreement/viewStandardAgreementById',
    type: 'get',
    response: config => {
      return {
        code: 1,
        data: {
          ...list.list[0]
        },
        msg: ''
      }
    }
  },
  // 发布标准协议
  {
    url: '/general/agreement/releaseStandardAgreement',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: ''
      }
    }
  },
  // 添加标准协议
  {
    url: '/general/agreement/addStandardAgreement',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: ''
      }
    }
  },
  // 修改标准协议
  {
    url: '/general/agreement/modifyStandardAgreement',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: ''
      }
    }
  }
]
